package com.hc.util;

import java.util.ArrayList;



public class PageHelp {

	//1.需要一个分页类
	//2.分页类中需要哪些必要属性
	//
	private int currentPage;//当前页
	private int countPage;//总页数--计算出来 改造get方法
	//（int）math.ceil(totalNum*1.0/pageSize)
	//if(totalNum%pageSize!=0){totalNum/pageSize+1}else{totalNum/pageSize}
	private int pageSize=5;//页面尺寸 
	private int totalNum;//数据总数--数据库可查
	//数据集合
	private ArrayList<?> arrayList = new ArrayList<>();
	
	
	public ArrayList<?> getArrayList() {
		return arrayList;
	}
	public void setArrayList(ArrayList<?> arrayList) {
		this.arrayList = arrayList;
	}
	public int getCurrentPage() {
		
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public int getCountPage() {//得到总页数
		return (int)Math.ceil(totalNum*1.0/pageSize);
	}
	public void setCountPage(int countPage) {
		this.countPage = countPage;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getTotalNum() {
		return totalNum;
	}
	public void setTotalNum(int totalNum) {
		this.totalNum = totalNum;
	}
	
	
	
}
